package com.ytf.test.fourth;

/**
 * @author: YTF
 * @date: 2024/9/14 15:07
 * @version: 1.0
 * @description: if 判断
 */
public class IfElse {
    private static int result =0;

    public static void main(String[] args) {
        test(10,5);
        System.out.println(result);
        test(5,10);
        System.out.println(result);
        test(5,5);
        System.out.println(result);
        /**
         * Output:
         * 1
         * -1
         * 0
         */
    }

    private static void test(int i, int i1) {
        if (i>i1){
            result = +1;
        }else if (i<i1){
            result = -1;
        }else{
            result = 0;
        }
    }
}
